%% 
%% This is file `answexam.tex', generated 
%% on <1995/3/4> with the docstrip utility (2.2i).
%% 
%% The original source files were:
%% 
%% answers.dtx  (with options: `example')
\documentclass[12pt,a4paper]{article}
\usepackage{answers}

\newtheorem{Ex}{Exercise}%% to produce the reference label

\Newassociation{solution}{Soln}{test}
\renewcommand{\Solnlabel}[1]{\emph{Solution #1}}
\Newassociation{hint}{Hint}{test}
\renewcommand{\Hintlabel}[1]{\emph{Hint #1}}
\Newassociation{Solution}{sSol}{testtwo}
\renewcommand{\sSollabel}[1]{\emph{Solution to #1}}
\renewcommand{\sSolparams}{{\Currentlabel(p.\thepage)}}

\begin{document}
\Opensolutionfile{test}
\Writetofile{test}{\protect\section{Solutions}}
\Opensolutionfile{testtwo}
\Writetofile{testtwo}{\protect\section{Extra Solutions}}
\section{First}
\begin{Ex}
   An exercise with a solution.
   \begin{solution}
      This is a solution.
      \relax{}
   \end{solution}
\end{Ex}
\begin{Ex}
   An exercise with a hint and a secret solution.
   \begin{hint}
      This is a hint.
   \end{hint}
   \begin{Solution}
      This is a secret solution.
   \end{Solution}
\end{Ex}
\begin{Ex}
   An exercise with a hint.
   \begin{hint}
      This is a hint.
   \end{hint}
\end{Ex}
\Closesolutionfile{test}
\Readsolutionfile{test}
\clearpage
\Closesolutionfile{testtwo}
\Readsolutionfile{testtwo}

\end{document}
\endinput
%% 
%% End of file `answexam.tex'.
